
//文件上传
const uploadFile=(file, fileName = 'file', success, fail) => {
  return wx.uploadFile({
    url: getApp().globalData.BASE_URL + '/cms/file',
    filePath: file,
    name: fileName,
    header: {
      Authorization: 'Bearer '+wx.getStorageSync('access_token'),
    },
    success: function (res) {
      success(res)
    }, fail: err => {
      fail(err)
    }
  });
}


module.exports = {
  uploadFile
}